<?php defined('IN_IA') or exit('Access Denied');?><?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/header', TEMPLATE_INCLUDEPATH)) : (include template('common/header', TEMPLATE_INCLUDEPATH));?>
<ul class="nav nav-tabs">
    <li class="active"><a href="<?php  echo $this->createWebUrl('tongji');?>">打卡列表</a></li>
</ul>
<script type="text/javascript">

    $(document).ready(function () {
        var val = $('#pid').val();
        change_pid(val);
        $('#pid').bind("change", function () {
            var v = $(this).val();
            $.post("../app/<?php  echo $this->createMobileUrl('pid')?>", {'pid': v},
                function (data) {
                    $('#pid2').html(data);
                });
        });
    });
    function change_pid(v) {
        $.post("../app/<?php  echo $this->createMobileUrl('pid')?>", {'pid': v},
            function (data) {
                $('#pid2').html(data);
            });
    }
</script>
<div class="panel panel-info">
    <div class="panel-heading">筛选</div>
    <div class="panel-body">
        <form action="./index.php" method="get" class="form-horizontal" role="form">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="haofa_kaoqin" />
            <input type="hidden" name="do" value="tongji" />
            <div class="form-group">
                <div class="col-xs-12 col-sm-2 col-lg-2">
                    <select name="bumen" class="form-control" id="pid">
                        <option value="">请选择部门</option>
                        <?php  if(is_array($bumen)) { foreach($bumen as $index => $item) { ?>
                        <option value="<?php  echo $item['id'];?>"><?php  echo $item['name'];?></option>
                        <?php  } } ?>
                    </select>
                </div>
                <div class="col-xs-12 col-sm-2 col-lg-2">
                    <select name="jingwushi" class="form-control" id="pid2">
                        <option value="">请选择警卫室</option>
                    </select>
                </div>
                <div class="col-xs-12 col-sm-3 col-lg-3">
                    <select name="year" class="form-control">
                        <option value="">选择年份</option>
                        <option value="2017">2017</option>
                        <option value="2018">2018</option>
                        <option value="2019">2019</option>
                    </select>
                </div>

                <div class="col-xs-12 col-sm-3 col-lg-3">
                    <select name="month" class="form-control">
                        <option value="">选择月份</option>
                        <option value="1">1月</option>
                        <option value="2">2月</option>
                        <option value="3">3月</option>
                        <option value="4">4月</option>
                        <option value="5">5月</option>
                        <option value="6">6月</option>
                        <option value="7">7月</option>
                        <option value="8">8月</option>
                        <option value="9">9月</option>
                        <option value="10">10月</option>
                        <option value="11">11月</option>
                        <option value="12">12月</option>
                    </select>
                </div>

                <div class="pull-right col-xs-12 col-sm-3 col-md-2 col-lg-2">
                    <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                </div>
            </div>
        </form>
    </div>
</div>

<?php  if($ftime) { ?>
<div class="panel panel-info">
    <div class="panel-heading">导出</div>
    <div class="panel-body">
        <form action="./index.php" method="get" class="form-horizontal" role="form">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="haofa_kaoqin" />
            <input type="hidden" name="do" value="export" />
            <input type="hidden" name="year" value="<?php  echo $_GPC['year'];?>" />
            <input type="hidden" name="month" value="<?php  echo $_GPC['month'];?>" />
            <input type="hidden" name="bumen" value="<?php  echo $_GPC['bumen'];?>" />
            <input type="hidden" name="jingweishi" value="<?php  echo $_GPC['jingwushi'];?>" />
            <div class="form-group">
                <div class="col-xs-12 col-sm-2 col-lg-2">
                    <button class="btn btn-success">导出</button>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="panel panel-default">
    <div class="panel-body table-responsive">
        <table class="table table-hover">
            <tbody id="main">
            <tr>
                <th width="100"><?php  echo $_GPC['year'];?>年<?php  echo $_GPC['month'];?>月</th>
                <th>01</th>
                <th>02</th>
                <th>03</th>
                <th>04</th>
                <th>05</th>
                <th>06</th>
                <th>07</th>
                <th>08</th>
                <th>09</th>
                <th>10</th>
                <th>11</th>
                <th>12</th>
                <th>13</th>
                <th>14</th>
                <th>15</th>
                <th>16</th>
                <th>17</th>
                <th>18</th>
                <th>19</th>
                <th>20</th>
                <th>21</th>
                <th>22</th>
                <th>23</th>
                <th>24</th>
                <th>25</th>
                <th>26</th>
                <th>27</th>
                <th>28</th>
                <th>29</th>
                <th>30</th>
                <th>31</th>
            </tr>
            <?php  if(is_array($user)) { foreach($user as $index => $item) { ?>
            <tr>
                <td><?php  echo $item['name'];?></td>
                <?php  if(is_array($ll)) { foreach($ll as $key => $value) { ?>
                <td>
                    <div style="border:solid 1px #efefef;text-align:center;margin-bottom:5px;">
                        <span style="color:red;">
                            <?php  if(is_array($item['user_day'])) { foreach($item['user_day'] as $k => $val) { ?>
                            <?php  if($key==$val['day'] && $val['shangwu'] ) { ?><?php  $kkk[$key][$item['name']]=1;?><?php  } ?>
                            <?php  } } ?>
                                  <?php  if($kkk[$key][$item['name']] ) { ?><a href="./index.php?c=site&a=entry&m=haofa_kaoqin&do=manage&id=<?php  echo $val['id'];?>">√</a><?php  } else { ?>×<?php  } ?>
                        </span>
                    </div>
                    <div style="border:solid 1px #efefef;text-align:center;margin-bottom:5px;">
                        <span style="color:red;">
                            <?php  if(is_array($item['user_day'])) { foreach($item['user_day'] as $k => $val) { ?>
                             <?php  if($key==$val['day'] && $val['xiawu'] ) { ?><?php  $kkk2[$key][$item['name']]=1;?><?php  } ?>
                            <?php  } } ?>
                            <?php  if($kkk2[$key][$item['name']] ) { ?><a href="./index.php?c=site&a=entry&m=haofa_kaoqin&do=manage&id=<?php  echo $val['id'];?>">√</a><?php  } else { ?>×<?php  } ?>
                        </span>
                    </div>
                </td>
                <?php  } } ?>
            </tr>
            <?php  } } ?>
            </tbody>
        </table>
    </div>
</div>

<?php  } ?>
<?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/footer', TEMPLATE_INCLUDEPATH)) : (include template('common/footer', TEMPLATE_INCLUDEPATH));?>